<%
  @feature_request = feature_request
  @feature_request.summary = h @feature_request.summary
  @feature_request.body = h @feature_request.body
%>

<li id="<%= dom_id(feature_request) %>">
  <span>
    <% if has_edit_permission?(@current_user, feature_request) %>
      <%= in_place_editor_field :feature_request, 'summary', {},
                                :size => 20,
                                :save_text => 'Save',
                                :cancel_text => 'Cancel' %>
    <% else %>
      <%= h(feature_request.summary).to_s.humanize %>
    <% end %>
  </span>

  &nbsp;
  <%= link_to_function icon_image_tag('notes.png'),
                        "#{update_page {|page| page.toggle "#{dom_id(feature_request)}_details"}}" %>
  &nbsp;
  <%= link_to_remote icon_image_tag('vote.png'),
                      :url => user_feature_request_votes_path(@current_user, feature_request, :listing_all_frs => (@listing_all_frs ? 1 : 0)),
                      :method => :post,
                      :loading => "#{update_page {|page| page[:progress_bar].show}}",
                      :complete => "#{update_page {|page| page[:progress_bar].hide}}" %>

  <% if has_edit_permission?(@current_user, feature_request) %>
    &nbsp;
    <%= link_to_remote icon_image_tag('delete.png'),
                        :url => [@current_user, feature_request],
                        :update => 'flash_messages',
                        :method => :delete,
                        :success => "#{update_page {|page| page.remove dom_id(feature_request) }}" %>
  <% end %>
  
  
  <div id="<%= dom_id(feature_request) %>_details" style="display: none; padding-left: 15px;">
    <% if has_edit_permission?(@current_user, feature_request) %>
      <%= in_place_editor_field :feature_request, 'body', {},
                                :rows => 3, :cols => 30,
                                :save_text => 'Save',
                                :cancel_text => 'Cancel' %>
    <% else %>
      <%= feature_request.body.to_s.humanize %>
    <% end %>
    <br>
    Rating: <%= feature_request.rating.to_i %>
  </div>
</li>